package com.acme.bankapp.domain.bank;

import com.acme.bankapp.domain.bank.BankException;
import com.acme.bankapp.domain.bank.NotEnoughFundsException;

public abstract class AbstractAccount implements Account 
{
	private double balance;
	
	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}
	
	public AbstractAccount(double balance) throws IllegalArgumentException {
		if (balance >= 0) {
			this.balance = balance;
		}
		else {
			throw new IllegalArgumentException();
		}
	}
	
	public abstract void deposit(double x);
	public abstract void withdraw(double x) throws NotEnoughFundsException;
	public abstract double maximumAmountToWithdraw();
}
